home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / smaltalk.lha / smalltalk-1.1.1 / mstbyte.c < prev    next >
C/C++ Source or Header  |  1991-09-12  |  18KB  |  814 lines

  1. /***********************************************************************
  2.  *
  3.  *    Byte code array utility routines.
  4.  *
  5.  ***********************************************************************/
  6.  
  7. /***********************************************************************
  8.  *
  9.  * Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  10.  * Written by Steve Byrne.
  11.  *
  12.  * This file is part of GNU Smalltalk.
  13.  *
  14.  * GNU Smalltalk is free software; you can redistribute it and/or modify it
  15.  * under the terms of the GNU General Public License as published by the Free
  16.  * Software Foundation; either version 1, or (at your option) any later 
  17.  * version.
  18.  * 
  19.  * GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  20.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  21.  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  22.  * more details.
  23.  * 
  24.  * You should have received a copy of the GNU General Public License along with
  25.  * GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  26.  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  27.  *
  28.  ***********************************************************************/
  29.  
  30.  
  31. /*
  32.  *    Change Log
  33.  * ============================================================================
  34.  * Author      Date       Change 
  35.  * sbyrne    20 Apr 90      Added initByteCodes to fix a robustness issue with
  36.  *              the compiler.
  37.  *
  38.  * sbyrne    27 Dec 88      created.
  39.  *
  40.  */
  41.  
  42. #include "mst.h"
  43. #include "mstbyte.h"
  44.  
  45. #define BYTE_CODE_CHUNK_SIZE        64
  46.  
  47. struct ByteCodeArray {
  48.   Byte        *base;        /* base of the byte code array */
  49.   Byte        *ptr;        /* current byte+1 of byte code array */
  50.   int        maxLen;        /* max allocated len of byte code array
  51.                    can be changed as byte code array grows,
  52.                    and is used to tell when to grow the byte
  53.                    code array. */
  54. };
  55.  
  56. ByteCodes        currentByteCodes = nil;
  57.  
  58. static ByteCodes    allocByteCodes();
  59. static void        compileByteCodes(), reallocByteCodes();
  60.  
  61.  
  62. /* These are used to decode special send byte codes. */
  63. static char        *mathMessageName[] = {
  64.   "+",
  65.   "-",
  66.   "<",
  67.   ">",
  68.   "<=",
  69.   ">=",
  70.   "=",
  71.   "~=",
  72.   "*",
  73.   "/",
  74.   "\\",
  75.   "@",
  76.   "bitShift:",
  77.   "//",
  78.   "bitAnd:",
  79.   "bitOr:"
  80. };
  81.  
  82. /* These are the selectors for special case send bytecodes that the compiler 
  83.    generates.  These are used only to print out the generated byte codes. */
  84. static char        *specialMessageName[] = {
  85.   "at:",
  86.   "at:put:",
  87.   "size",
  88.   "next",
  89.   "nextPut:",
  90.   "atEnd",
  91.   "==",
  92.   "class",
  93.   "blockCopy:",
  94.   "value",
  95.   "value:",
  96.   "do:",
  97.   "new",
  98.   "new:",
  99.   "x",
  100.   "y"
  101. };
  102.  
  103. void compileByte(byte)
  104. Byte byte;
  105. {
  106.   if (currentByteCodes == nil) {
  107.     currentByteCodes = allocByteCodes();
  108.   }
  109.  
  110.   if ((currentByteCodes->ptr - currentByteCodes->base)
  111.       >= currentByteCodes->maxLen) {
  112.     reallocByteCodes(currentByteCodes);
  113.   }
  114.  
  115.   *currentByteCodes->ptr++ = byte;
  116. }
  117.  
  118. void compileAndFreeByteCodes(byteCodes)
  119. ByteCodes byteCodes;
  120. {
  121.   compileByteCodes(byteCodes);
  122.   freeByteCodes(byteCodes);
  123. }
  124.  
  125. /*
  126.  *    void initByteCodes()
  127.  *
  128.  * Description
  129.  *
  130.  *    Initialize the byte code system.  Basically used to set the byte code
  131.  *    system to a known state, typically in preparation for compilation.
  132.  *
  133.  */
  134. void initByteCodes()
  135. {
  136.   if (currentByteCodes) {
  137.     free(currentByteCodes);    /* ??? this might lose if trashed. */
  138.     currentByteCodes = nil;
  139.   }
  140. }
  141.  
  142. /*
  143.  *    ByteCodes getByteCodes()
  144.  *
  145.  * Description
  146.  *
  147.  *    Called when byte code compilation is complete, this routine returns the
  148.  *    set of byte codes that were compiled.  Since compilation is complete,
  149.  *    this routine also resets the internal state of the byte code compiler
  150.  *    in preparation for next time.
  151.  *
  152.  * Outputs
  153.  *
  154.  *    A pointer to a byte code array that contains the bytes for the current
  155.  *    compilation.
  156.  */
  157. ByteCodes getByteCodes()
  158. {
  159.   ByteCodes    curByteCodes;
  160.  
  161.   curByteCodes = currentByteCodes;
  162.   currentByteCodes = nil;
  163.  
  164.   return (curByteCodes);
  165. }
  166.  
  167.  
  168. /*
  169.  *    ByteCodes saveByteCodeArray()
  170.  *
  171.  * Description
  172.  *
  173.  *    Called to save the set of byte codes currently being compiled and
  174.  *    prepare for a new compilation of byte codes.  The current set of byte
  175.  *    codes being compiled is returned for the caller to keep and to later
  176.  *    use in a restoreByteCodeArray call.
  177.  *
  178.  * Outputs
  179.  *
  180.  *    A byte code array pointer to the current byte codes.
  181.  */
  182. ByteCodes saveByteCodeArray()
  183. {
  184.   ByteCodes    curByteCodes;
  185.  
  186.   curByteCodes = currentByteCodes;
  187.   currentByteCodes = nil;
  188.  
  189.   return (curByteCodes);
  190. }
  191.  
  192.  
  193. /*
  194.  *    void restoreByteCodeArray(byteCodes)
  195.  *
  196.  * Description
  197.  *
  198.  *    Restores the internal state of the byte code compiler so that it can
  199.  *    continue compiling byte codes into the byte code array "byteCodes",
  200.  *    which should have been returned at some previous point from
  201.  *    saveByteCodeArray().
  202.  *
  203.  * Inputs
  204.  *
  205.  *    byteCodes: 
  206.  *        The byte code array pointer to be restored.  Should have come
  207.  *        from a saveByteCodeArray call.
  208.  *
  209.  */
  210. void restoreByteCodeArray(byteCodes)
  211. ByteCodes byteCodes;
  212. {
  213.   currentByteCodes = byteCodes;
  214. }
  215.  
  216. int byteCodeLength(byteCodes)
  217. ByteCodes byteCodes;
  218. {
  219.   return (byteCodes->ptr - byteCodes->base);
  220. }
  221.  
  222.  
  223. /*
  224.  *    int currentByteCodeLength()
  225.  *
  226.  * Description
  227.  *
  228.  *    Return the current number of byte codes that have been compiled.
  229.  *
  230.  * Outputs
  231.  *
  232.  *    Number of byte codes present in the current byte code array right now.
  233.  */
  234. int currentByteCodeLength()
  235. {
  236.   if (currentByteCodes == nil) {
  237.     return (0);
  238.   }
  239.  
  240.   return (currentByteCodes->ptr - currentByteCodes->base);
  241. }
  242.  
  243. int isSimpleReturn(byteCodes)
  244. ByteCodes byteCodes;
  245. {
  246.   Byte        *bytes;
  247.   long        byteCodeLen;
  248.  
  249.   if (byteCodes == nil) {
  250.     return (0);
  251.   }
  252.  
  253.   byteCodeLen = byteCodeLength(byteCodes);
  254.   bytes = byteCodes->base;
  255.  
  256.   /* check for ^self */
  257.   if (byteCodeLen == 1 && bytes[0] == (returnIndexed | receiverIndex)) {
  258.     return (1);
  259.   }
  260.  
  261.   /* check for ^instanceVariable */
  262.   if (byteCodeLen == 2) {
  263.     if ((bytes[0] & ~0x0F) == pushReceiverVariable
  264.     && bytes[1] == returnMethodStackTop) {
  265.       return (((bytes[0] & 0x0F) << 8) | 2);
  266.     }
  267.   } else if (byteCodeLen == 3) {
  268.     if (bytes[0] == pushIndexed
  269.      && (bytes[1] & locationMask) == receiverLocation
  270.      && bytes[2] == returnMethodStackTop) {
  271.       return (((bytes[1] & ~locationMask) << 8) | 2);
  272.     }
  273.   }
  274.  
  275.   return (0);
  276. }
  277.  
  278. void copyByteCodes(dest, byteCodes)
  279. Byte    *dest;
  280. ByteCodes byteCodes;
  281. {
  282.   memcpy(dest, byteCodes->base, byteCodeLength(byteCodes));
  283. }
  284.  
  285. /***********************************************************************
  286.  *
  287.  *    Internal routines.
  288.  *
  289.  ***********************************************************************/
  290.  
  291. static void compileByteCodes(byteCodes)
  292. register ByteCodes byteCodes;
  293. {
  294.   register Byte        *ptr;
  295.  
  296.   for (ptr = byteCodes->base; ptr < byteCodes->ptr; ptr++) {
  297.     compileByte(*ptr);
  298.   }
  299. }
  300.  
  301. static ByteCodes allocByteCodes()
  302. {
  303.   ByteCodes    newByteCodes;
  304.  
  305.   newByteCodes = (ByteCodes)malloc(sizeof(struct ByteCodeArray));
  306.   newByteCodes->base = (Byte *)malloc(BYTE_CODE_CHUNK_SIZE);
  307.   newByteCodes->ptr = newByteCodes->base;
  308.   newByteCodes->maxLen = BYTE_CODE_CHUNK_SIZE;
  309.  
  310.   return (newByteCodes);
  311. }
  312.  
  313. static void reallocByteCodes(byteCodes)
  314. ByteCodes byteCodes;
  315. {
  316.   Byte        *newBytes;
  317.   int        newLen;
  318.  
  319.   if (byteCodes->maxLen != (byteCodes->ptr - byteCodes->base)) {
  320.     errorf("reallocByteCodes called with maxLen != byteCode len");
  321.   }
  322.  
  323.   newLen = byteCodes->maxLen + BYTE_CODE_CHUNK_SIZE;
  324.   newBytes = (Byte *)malloc(newLen);
  325.   memcpy(newBytes, byteCodes->base, byteCodes->maxLen);
  326.   free(byteCodes->base);
  327.  
  328.   byteCodes->base = newBytes;
  329.   byteCodes->ptr = newBytes + byteCodes->maxLen;
  330.   byteCodes->maxLen = newLen;
  331. }
  332.  
  333. void freeByteCodes(byteCodes)
  334. ByteCodes byteCodes;
  335. {
  336.   if (byteCodes != nil) {
  337.     free(byteCodes->base);
  338.     free(byteCodes);
  339.   }
  340. }
  341.  
  342. void printByteCodes(byteCodes, literalVec)
  343. ByteCodes byteCodes;
  344. OOP    literalVec[];
  345. {
  346.   Byte        *b, b1;
  347.   int        ip;
  348.  
  349.   if (byteCodes == nil) {
  350.     return;
  351.   }
  352.  
  353.   for (b = byteCodes->base; b < byteCodes->ptr; b++) {
  354.     ip = b - byteCodes->base;
  355.     printf("%5d:\t", ip);
  356.     printByteCodeName(b, ip, literalVec);
  357.     printf("\n");
  358.     switch (*b) {
  359.     case  0: case  1: case  2: case  3:
  360.     case  4: case  5: case  6: case  7:
  361.     case  8: case  9: case 10: case 11:
  362.     case 12: case 13: case 14: case 15:
  363.       break;
  364.  
  365.     case 16: case 17: case 18: case 19:
  366.     case 20: case 21: case 22: case 23:
  367.     case 24: case 25: case 26: case 27:
  368.     case 28: case 29: case 30: case 31:
  369.       break;
  370.  
  371.     case 32: case 33: case 34: case 35:
  372.     case 36: case 37: case 38: case 39:
  373.     case 40: case 41: case 42: case 43:
  374.     case 44: case 45: case 46: case 47:
  375.     case 48: case 49: case 50: case 51:
  376.     case 52: case 53: case 54: case 55:
  377.     case 56: case 57: case 58: case 59:
  378.     case 60: case 61: case 62: case 63:
  379.       break;
  380.  
  381.     case 64: case 65: case 66: case 67:
  382.     case 68: case 69: case 70: case 71:
  383.     case 72: case 73: case 74: case 75:
  384.     case 76: case 77: case 78: case 79:
  385.     case 80: case 81: case 82: case 83:
  386.     case 84: case 85: case 86: case 87:
  387.     case 88: case 89: case 90: case 91:
  388.     case 92: case 93: case 94: case 95:
  389.       break;
  390.  
  391.     case  96: case  97: case  98: case  99:
  392.     case 100: case 101: case 102: case 103:
  393.       break;
  394.  
  395.     case 104: case 105: case 106: case 107:
  396.     case 108: case 109: case 110: case 111:
  397.       break;
  398.  
  399.     case 112:
  400.       break;
  401.  
  402.     case 113: 
  403.       break;
  404.  
  405.     case 114:
  406.       break;
  407.  
  408.     case 115:
  409.       break;
  410.  
  411.     case 116:
  412.       break;
  413.  
  414.     case 117:
  415.       break;
  416.  
  417.     case 118:
  418.       break;
  419.  
  420.     case 119:
  421.       break;
  422.  
  423.     case 120:
  424.       break;
  425.       
  426.     case 121:
  427.       break;
  428.  
  429.     case 122:
  430.       break;
  431.  
  432.     case 123:
  433.       break;
  434.       
  435.     case 124:
  436.       break;
  437.  
  438.     case 125:
  439.       break;
  440.  
  441.     case 126: case 127:
  442.       break;
  443.  
  444.     case 128:
  445.       b++;
  446.       break;
  447.  
  448.     case 129:
  449.       b++;
  450.       break;
  451.  
  452.     case 130:
  453.       b++;
  454.       break;
  455.  
  456.     case 131:
  457.       b++;
  458.       break;
  459.  
  460.     case 132:
  461.       b += 2;
  462.       break;
  463.  
  464.     case 133:
  465.       b++;
  466.       break;
  467.  
  468.     case 134:
  469.       b += 2;
  470.       break;
  471.  
  472.     case 135:
  473.       break;
  474.  
  475.     case 136:
  476.       break;
  477.  
  478.     case 137:
  479.       break;
  480.  
  481.     case 138: case 139: case 140: case 141: 
  482.     case 142: case 143:
  483.       break;
  484.  
  485.     case 144: case 145: case 146: case 147:
  486.     case 148: case 149: case 150: case 151:
  487.       break;
  488.  
  489.     case 152: case 153: case 154: case 155:
  490.     case 156: case 157: case 158: case 159:
  491.       break;
  492.  
  493.     case 160: case 161: case 162: case 163:
  494.     case 164: case 165: case 166: case 167:
  495.       b++;
  496.       break;
  497.  
  498.     case 168: case 169: case 170: case 171:
  499.       b++;
  500.       break;
  501.  
  502.     case 172: case 173: case 174: case 175:
  503.       b++;
  504.       break;
  505.  
  506.     case 176: case 177: case 178: case 179: 
  507.     case 180: case 181: case 182: case 183: 
  508.     case 184: case 185: case 186: case 187: 
  509.     case 188: case 189: case 190: case 191: 
  510.       break;
  511.  
  512.     case 192: case 193: case 194: case 195: 
  513.     case 196: case 197: case 198: case 199: 
  514.     case 200: case 201: case 202: case 203: 
  515.     case 204: case 205: case 206: case 207: 
  516.       break;
  517.  
  518.     case 208: case 209: case 210: case 211: 
  519.     case 212: case 213: case 214: case 215: 
  520.     case 216: case 217: case 218: case 219: 
  521.     case 220: case 221: case 222: case 223: 
  522.       break;
  523.  
  524.     case 224: case 225: case 226: case 227: 
  525.     case 228: case 229: case 230: case 231: 
  526.     case 232: case 233: case 234: case 235: 
  527.     case 236: case 237: case 238: case 239: 
  528.       break;
  529.  
  530.     case 240: case 241: case 242: case 243: 
  531.     case 244: case 245: case 246: case 247: 
  532.     case 248: case 249: case 250: case 251: 
  533.     case 252: case 253: case 254: case 255: 
  534.       break;
  535.  
  536.     default:
  537.       break;
  538.     }
  539.   }
  540.   printf("\n");
  541. }
  542.  
  543. void printByteCodeName(bp, ip, literalVec)
  544. Byte    bp[];
  545. int    ip;
  546. OOP    literalVec[];
  547. {
  548.   switch (bp[0]) {
  549.   case  0: case  1: case  2: case  3:
  550.   case  4: case  5: case  6: case  7:
  551.   case  8: case  9: case 10: case 11:
  552.   case 12: case 13: case 14: case 15:
  553.     printf("push Instance Variable[%d]", bp[0] & 15);
  554.     break;
  555.  
  556.   case 16: case 17: case 18: case 19:
  557.   case 20: case 21: case 22: case 23:
  558.   case 24: case 25: case 26: case 27:
  559.   case 28: case 29: case 30: case 31:
  560.     printf("push Temporary[%d]", bp[0] & 15);
  561.     break;
  562.     
  563.   case 32: case 33: case 34: case 35:
  564.   case 36: case 37: case 38: case 39:
  565.   case 40: case 41: case 42: case 43:
  566.   case 44: case 45: case 46: case 47:
  567.   case 48: case 49: case 50: case 51:
  568.   case 52: case 53: case 54: case 55:
  569.   case 56: case 57: case 58: case 59:
  570.   case 60: case 61: case 62: case 63:
  571.     printf("push Literal[%d]", bp[0] & 31);
  572.     break;
  573.     
  574.   case 64: case 65: case 66: case 67:
  575.   case 68: case 69: case 70: case 71:
  576.   case 72: case 73: case 74: case 75:
  577.   case 76: case 77: case 78: case 79:
  578.   case 80: case 81: case 82: case 83:
  579.   case 84: case 85: case 86: case 87:
  580.   case 88: case 89: case 90: case 91:
  581.   case 92: case 93: case 94: case 95:
  582.     printf("push Global Variable[%d] = ", bp[0] & 31);
  583.     printAssociationKey(literalVec[bp[0] & 31]);
  584.     break;
  585.     
  586.   case  96: case  97: case  98: case  99:
  587.   case 100: case 101: case 102: case 103:
  588.     printf("pop and store Instance Variable[%d]", bp[0] & 7);
  589.     break;
  590.     
  591.   case 104: case 105: case 106: case 107:
  592.   case 108: case 109: case 110: case 111:
  593.     printf("pop and store Temporary[%d]", bp[0] & 7);
  594.     break;
  595.     
  596.   case 112:
  597.     printf("push self");
  598.     break;
  599.     
  600.   case 113: 
  601.     printf("push true");
  602.     break;
  603.     
  604.   case 114:
  605.     printf("push false");
  606.     break;
  607.     
  608.   case 115:
  609.     printf("push nil");
  610.     break;
  611.     
  612.   case 116:
  613.     printf("push -1");
  614.     break;
  615.     
  616.   case 117:
  617.     printf("push 0");
  618.     break;
  619.     
  620.   case 118:
  621.     printf("push 1");
  622.     break;
  623.     
  624.   case 119:
  625.     printf("push 2");
  626.     break;
  627.     
  628.   case 120:
  629.     printf("return self");
  630.     break;
  631.     
  632.   case 121:
  633.     printf("return true");
  634.     break;
  635.     
  636.   case 122:
  637.     printf("return false");
  638.     break;
  639.     
  640.   case 123:
  641.     printf("return nil");
  642.     break;
  643.     
  644.   case 124:
  645.     printf("return Message stack top");
  646.     break;
  647.     
  648.   case 125:
  649.     printf("return Block stack top");
  650.     break;
  651.     
  652.   case 126: case 127:
  653.     printf("Bytecode %d ILLEGAL!!!", bp[0]);
  654.     break;
  655.     
  656.   case 128:
  657.     switch (bp[1] >> 6) {
  658.     case 0:
  659.       printf("push Instance Variable[%d]", bp[1] & 63);
  660.       break;
  661.     case 1:
  662.       printf("push Temporary[%d]", bp[1] & 63);
  663.       break;
  664.     case 2:
  665.       printf("push Constant[%d]", bp[1] & 63);
  666.       break;
  667.     case 3:
  668.       printf("push Global Variable[%d] = ", bp[1] & 63);
  669.       printAssociationKey(literalVec[bp[1] & 63]);
  670.       break;
  671.     }
  672.     break;
  673.     
  674.   case 129:
  675.     switch (bp[1] >> 6) {
  676.     case 0:
  677.       printf("store Instance Variable[%d]", bp[1] & 63);
  678.       break;
  679.     case 1:
  680.       printf("store Temporary[%d]", bp[1] & 63);
  681.       break;
  682.     case 2:
  683.       printf("Illegal store into constant[%d]", bp[1] & 63);
  684.       break;
  685.     case 3:
  686.       printf("store Global Variable[%d] = ", bp[1] & 63);
  687.       printAssociationKey(literalVec[bp[1] & 63]);
  688.       break;
  689.     }
  690.     break;
  691.     
  692.   case 130:
  693.     switch (bp[1] >> 6) {
  694.     case 0:
  695.       printf("pop and store Instance Variable[%d]", bp[1] & 63);
  696.       break;
  697.     case 1:
  698.       printf("pop and store Temporary[%d]", bp[1] & 63);
  699.       break;
  700.     case 2:
  701.       printf("lllegal pop and store into constant[%d]", bp[1] & 63);
  702.       break;
  703.     case 3:
  704.       printf("pop and store Global Variable[%d]", bp[1] & 63);
  705.       printAssociationKey(literalVec[bp[1] & 63]);
  706.       break;
  707.     }
  708.     break;
  709.     
  710.   case 131:
  711.     printf("send selector %d, %d args = ", bp[1] & 31, bp[1] >> 5);
  712.     printSymbol(literalVec[bp[1] & 31]);
  713.     break;
  714.     
  715.   case 132:
  716.     printf("send selector %d, %d args = ", bp[2], bp[1]);
  717.     printSymbol(literalVec[bp[2]]);
  718.     break;
  719.     
  720.   case 133:
  721.     printf("send to super selector %d, %d args = ", bp[1] & 31, bp[1] >> 5);
  722.     printSymbol(literalVec[bp[1] & 31]);
  723.     break;
  724.     
  725.   case 134:
  726.     printf("send to super selector %d, %d args = ", bp[2], bp[1]);
  727.     printSymbol(literalVec[bp[2]]);
  728.     break;
  729.     
  730.   case 135:
  731.     printf("pop stack top");
  732.     break;
  733.     
  734.   case 136:
  735.     printf("duplicate stack top");
  736.     break;
  737.     
  738.     
  739.   case 137:
  740.     printf("push current context");
  741.     break;
  742.     
  743.   case 138: case 139: case 140: case 141: 
  744.   case 142: case 143:
  745.     printf("Illegal bytecode %d!!!", bp[0]);
  746.     break;
  747.     
  748.   case 144: case 145: case 146: case 147:
  749.   case 148: case 149: case 150: case 151:
  750.     printf("jump to %d", (bp[0] & 7) + ip + 1 + 1);
  751.     break;
  752.     
  753.   case 152: case 153: case 154: case 155:
  754.   case 156: case 157: case 158: case 159:
  755.     printf("jump to %d if false", (bp[0] & 7) + ip + 1 + 1);
  756.     break;
  757.     
  758.   case 160: case 161: case 162: case 163:
  759.   case 164: case 165: case 166: case 167:
  760.     printf("jump to %d", ((bp[0]&7)-4) * 256 + bp[1] + ip + 2);
  761.     break;
  762.     
  763.   case 168: case 169: case 170: case 171:
  764.     printf("pop and jump to %d if true", (bp[0]&3) * 256 + bp[1] + ip + 2);
  765.     break;
  766.     
  767.   case 172: case 173: case 174: case 175:
  768.     printf("pop and jump to %d if false", (bp[0]&3) * 256 + bp[1] + ip + 2);
  769.     break;
  770.     
  771.   case 176: case 177: case 178: case 179: 
  772.   case 180: case 181: case 182: case 183: 
  773.   case 184: case 185: case 186: case 187: 
  774.   case 188: case 189: case 190: case 191: 
  775.     printf("send arithmetic message \"%s\"", mathMessageName[bp[0] & 15]);
  776.     break;
  777.     
  778.   case 192: case 193: case 194: case 195: 
  779.   case 196: case 197: case 198: case 199: 
  780.   case 200: case 201: case 202: case 203: 
  781.   case 204: case 205: case 206: case 207: 
  782.     printf("send special message \"%s\"", specialMessageName[bp[0] & 15]);
  783.     break;
  784.     
  785.   case 208: case 209: case 210: case 211: 
  786.   case 212: case 213: case 214: case 215: 
  787.   case 216: case 217: case 218: case 219: 
  788.   case 220: case 221: case 222: case 223: 
  789.     printf("send selector %d, 0 args = ", bp[0] & 15);
  790.     printSymbol(literalVec[bp[0] & 15]);
  791.     break;
  792.     
  793.   case 224: case 225: case 226: case 227: 
  794.   case 228: case 229: case 230: case 231: 
  795.   case 232: case 233: case 234: case 235: 
  796.   case 236: case 237: case 238: case 239: 
  797.     printf("send selector %d, 1 arg = ", bp[0] & 15);
  798.     printSymbol(literalVec[bp[0] & 15]);
  799.     break;
  800.     
  801.   case 240: case 241: case 242: case 243: 
  802.   case 244: case 245: case 246: case 247: 
  803.   case 248: case 249: case 250: case 251: 
  804.   case 252: case 253: case 254: case 255: 
  805.     printf("send selector %d, 2 args = ", bp[0] & 15);
  806.     printSymbol(literalVec[bp[0] & 15]);
  807.     break;
  808.     
  809.   default:
  810.     printf("UNHANDLED BYTE CODE %d!!!", bp[0]);
  811.     break;
  812.   }
  813. }
  814.